﻿<Page x:Class="CustomControl.IfThenSummaryPage"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      xmlns:sys="clr-namespace:System;assembly=mscorlib"
      xmlns:local="clr-namespace:CustomControl"
	  xmlns:scm="clr-namespace:System.ComponentModel;assembly=WindowsBase"
      mc:Ignorable="d" 
      d:DesignHeight="300" d:DesignWidth="300"
      Title="IfThenSummaryPage">
	<Page.Resources>
		<CollectionViewSource x:Key="sortedIfStatements" Source="{Binding IfStatements}">
			<CollectionViewSource.SortDescriptions>
				<scm:SortDescription PropertyName="Order"></scm:SortDescription>
				<scm:SortDescription PropertyName="Name"></scm:SortDescription>
			</CollectionViewSource.SortDescriptions>
		</CollectionViewSource>
		
		
	</Page.Resources>

	<WrapPanel local:MarginSetter.Margin="5">
		<TextBlock Text="If" Style="{StaticResource WrapTextStyle}"></TextBlock>
		<ComboBox  MinWidth="80" Style="{DynamicResource ComboBoxStyle1}" 
				   Background="Transparent"
				   ItemsSource="{Binding Source={StaticResource sortedIfStatements}}"
				   DisplayMemberPath="Name"
				   SelectedItem="{Binding SelectedIfStatement}"
				   ItemContainerStyle="{DynamicResource ComboBoxItemStyle1}"
				   ItemsPanel="{DynamicResource ItemsPanelTemplate1}">

		</ComboBox>
		<TextBlock Text="then" Style="{StaticResource WrapTextStyle}"></TextBlock>
		<!--<ComboBox MinWidth="80" Style="{DynamicResource ComboBoxStyle1}" 
				  Background="Transparent"	  
				  ItemsSource="{Binding ThenStatements}"
				  DisplayMemberPath="Name"
				  SelectedItem="{Binding SelectedThenStatement}"
				  ItemContainerStyle="{DynamicResource ComboBoxItemStyle1}"
				  ItemsPanel="{DynamicResource ItemsPanelTemplate1}"></ComboBox>-->
		<Button Content="{Binding SelectedThenStatement.Name}" Style="{DynamicResource WrapButtonStyle}" Click="Button_Click"/>
		<!--<TextBlock Text="{Binding SelectedThenStatement.Name}" Style="{StaticResource WrapLinkStyle}"></TextBlock>-->

		
	</WrapPanel>
</Page>
